home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmMain
- Caption = "Cell VBDemo"
- ClientHeight = 4752
- ClientLeft = 168
- ClientTop = 456
- ClientWidth = 6972
- LinkTopic = "Form1"
- ScaleHeight = 4752
- ScaleWidth = 6972
- StartUpPosition = 2 'CenterScreen
- WindowState = 2 'Maximized
- Begin VB.Menu FileMenu
- Caption = "File(&F)"
- Begin VB.Menu mnuExit
- Caption = "Exit(&X)"
- End
- End
- Begin VB.Menu mnuFeature
- Caption = "Features(&T)"
- Begin VB.Menu mnuFeatures
- Caption = "Window"
- Index = 1
- End
- Begin VB.Menu mnuFeatures
- Caption = "Sizing"
- Index = 2
- End
- Begin VB.Menu mnuFeatures
- Caption = "Background"
- Index = 3
- End
- Begin VB.Menu mnuFeatures
- Caption = "Cell Style"
- Index = 4
- End
- Begin VB.Menu mnuFeatures
- Caption = "Cell Type"
- Index = 5
- End
- Begin VB.Menu mnuFeatures
- Caption = "Input"
- Index = 6
- End
- Begin VB.Menu mnuFeatures
- Caption = "Cell Formula"
- Index = 7
- End
- Begin VB.Menu mnuFeatures
- Caption = "Chart"
- Index = 8
- End
- Begin VB.Menu mnuFeatures
- Caption = "Virtual Grid"
- Index = 9
- End
- Begin VB.Menu mnuFeatures
- Caption = "User defined Function"
- Index = 10
- End
- Begin VB.Menu mnuFeatures
- Caption = "Cut Copy Paste"
- Index = 11
- End
- Begin VB.Menu mnuFeatures
- Caption = "Drag Drop"
- Index = 12
- End
- Begin VB.Menu mnuFeatures
- Caption = "Sort"
- Index = 13
- End
- Begin VB.Menu mnuFeatures
- Caption = "Pint Preview"
- Index = 14
- End
- Begin VB.Menu mnuFeatures
- Caption = "Pages"
- Index = 15
- End
- Begin VB.Menu mnuFeatures
- Caption = "Drop Window"
- Index = 16
- End
- Begin VB.Menu mnuFeatures
- Caption = "Open Dbase"
- Index = 17
- End
- Begin VB.Menu mnuFeatures
- Caption = "File Save"
- Index = 18
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "Help(&H)"
- Begin VB.Menu mnuHelpAbout
- Caption = "About(&A)"
- End
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim iDefaultHeight As Integer
- Dim iDefaultWidth As Integer
- Private Sub subDropWindow()
- With frmCell.DemoCell
- .DoSetCellString 0, 1, "Button"
- .DoSetCellString 0, 3, "Check box"
- .DoSetCellString 0, 5, "Drop window(row select style)"
- .DoSetCellString 0, 7, "Drop window"
- .DoSetCellString 0, 9, "Drop window(data from page 2)"
- .DoSetButtonCell 2, 1, "press me", "You press here"
- .DoSetCheckboxCell 2, 3, "a check box"
- .DoSetDropGridCell 2, 5, 0, 0, 5, 5, 0, 1, 0, 0, 0
- .DoSetDropGridCell 2, 7, 0, 0, 5, 5, 0, 0, 0, 0, 0
- .DoSetDropGridCell 2, 9, 0, 0, 5, 5, 1, 0, 0, 0, 0
- .DoAppendPage "", 1
- .DoSetCurrentPage 1
- .DoSetCellString 0, 1, "This cell from"
- .DoSetCellString 0, 2, "page 2"
- .DoSetCurrentPage 0
- .DoSetMessageTitle "VB DEMO"
- End With
- End Sub
- Private Sub subPages()
- frmCell.DemoCell.DoSetTotalPages 100
- End Sub
- Private Sub subPrint()
- With frmCell.DemoCell
- .DoSetCellString 0, 0, "interest rate"
- .DoSetCellString 1, 0, "three month"
- .DoSetCellString 2, 0, "half year"
- .DoSetCellString 3, 0, "one year"
- .DoSetCellString 4, 0, "two year"
- .DoSetCellString 5, 0, "three year"
- .DoSetCellString 6, 0, "five year"
- .DoSetCellString 0, 1, "month interest rate"
- .DoSetCellValue 1, 1, 2.4
- .DoSetCellValue 2, 1, 3.45
- .DoSetCellValue 3, 1, 4.725
- .DoSetCellValue 4, 1, 4.95
- .DoSetCellValue 5, 1, 5.175
- .DoSetCellValue 6, 1, 5.55
- .DoSetCellString 0, 2, "year interest rate"
- .DoSetCellValue 1, 2, 2.88
- .DoSetCellValue 2, 2, 4.14
- .DoSetCellValue 3, 2, 5.67
- .DoSetCellValue 4, 2, 5.94
- .DoSetCellValue 5, 2, 6.21
- .DoSetCellValue 6, 2, 6.66
- .DoJoinCells 1, 4, 5, 8
- .DoSetRefChart 1, 4, 0, 0, 6, 2
- .DoJoinCells 1, 10, 5, 14
- .DoSetChart 1, 10, 5, 5
- .DoSetChartStringData 1, 10, 0, 0, "Area"
- .DoSetChartStringData 1, 10, 1, 0, "Washington"
- .DoSetChartStringData 1, 10, 2, 0, "New York"
- .DoSetChartStringData 1, 10, 3, 0, "Florida"
- .DoSetChartStringData 1, 10, 4, 0, "Colorado"
- .DoSetChartStringData 1, 10, 0, 1, "first quarter"
- .DoSetChartStringData 1, 10, 0, 2, "second quarter"
- .DoSetChartStringData 1, 10, 0, 3, "third quarter"
- .DoSetChartStringData 1, 10, 0, 4, "fourth quarter"
- .DoSetChartValueData 1, 10, 1, 1, 29876
- .DoSetChartValueData 1, 10, 1, 2, 34123
- .DoSetChartValueData 1, 10, 1, 3, 42221
- .DoSetChartValueData 1, 10, 1, 4, 52123
- .DoSetChartValueData 1, 10, 2, 1, 32365
- .DoSetChartValueData 1, 10, 2, 2, 35432
- .DoSetChartValueData 1, 10, 2, 3, 30283
- .DoSetChartValueData 1, 10, 2, 4, 45322
- .DoSetChartValueData 1, 10, 3, 1, 32007
- .DoSetChartValueData 1, 10, 3, 2, 23481
- .DoSetChartValueData 1, 10, 3, 3, 40624
- .DoSetChartValueData 1, 10, 3, 4, 34528
- .DoSetChartValueData 1, 10, 4, 1, 31232
- .DoSetChartValueData 1, 10, 4, 2, 30345
- .DoSetChartValueData 1, 10, 4, 3, 27943
- .DoSetChartValueData 1, 10, 4, 4, 32109
- .DoSetChartGeneralData 1, 10, 1, False, "sale", "figure2", "thousand dollar"
- .DoRefreshChart 1, 10
- .PageLabelVisible = False
- End With
- End Sub
- Private Sub subSort()
- With frmCell.DemoCell
- .Cols = 6
- .Rows = 8
- .DoSetBackGround 4
- .DoSetCellString 0, -1, "Stock"
- .DoSetCellString 1, -1, "Open"
- .DoSetCellString 2, -1, "Rise/Drop"
- .DoSetCellString 3, -1, "Noon Volume"
- .DoSetCellString 4, -1, "10:10"
- .DoSetCellString 5, -1, "Volume"
- .DoSetCellString 0, 0, "Microsoft"
- .DoSetCellValue 1, 0, 27.5
- .DoSetCellValue 2, 0, -0.57
- .DoSetCellValue 3, 0, 1116200
- .DoSetCellValue 4, 0, 27.6
- .DoSetCellValue 5, 0, 338700
- .DoSetCellString 0, 1, "IBM"
- .DoSetCellValue 1, 1, 9.59
- .DoSetCellValue 2, 1, -1.94
- .DoSetCellValue 3, 1, 317000
- .DoSetCellValue 4, 1, 9.7
- .DoSetCellValue 5, 1, 45600
- .DoSetCellString 0, 2, "Sun"
- .DoSetCellValue 1, 2, 11.3
- .DoSetCellValue 2, 2, 0.89
- .DoSetCellValue 3, 2, 333200
- .DoSetCellValue 4, 2, 11.21
- .DoSetCellValue 5, 2, 20700
- .DoSetCellString 0, 3, "Oracle"
- .DoSetCellValue 1, 3, 13.52
- .DoSetCellValue 2, 3, -2.02
- .DoSetCellValue 3, 3, 378500
- .DoSetCellValue 4, 3, 13.68
- .DoSetCellValue 5, 3, 26500
- .DoSetCellString 0, 4, "Sybase"
- .DoSetCellValue 1, 4, 15.82
- .DoSetCellValue 2, 4, -1.12
- .DoSetCellValue 3, 4, 799600
- .DoSetCellValue 4, 4, 15.81
- .DoSetCellValue 5, 4, 69600
- .DoSetCellString 0, 5, "Adobe"
- .DoSetCellValue 1, 5, 6.3
- .DoSetCellValue 2, 5, -1.4
- .DoSetCellValue 3, 5, 476000
- .DoSetCellValue 4, 5, 6.43
- .DoSetCellValue 5, 5, 195500
- .DoSetCellString 0, 6, "CA"
- .DoSetCellValue 1, 6, 10.21
- .DoSetCellValue 2, 6, -0.68
- .DoSetCellValue 3, 6, 221300
- .DoSetCellValue 4, 6, 10.26
- .DoSetCellValue 5, 6, 21200
- .DoSetCellString 0, 7, "AT&T"
- .DoSetCellValue 1, 7, 9.1
- .DoSetCellValue 2, 7, -2.04
- .DoSetCellValue 3, 7, 1014800
- .DoSetCellValue 4, 7, 9.12
- .DoSetCellValue 5, 7, 97000
- .DoSetCellString 0, 8, "North"
- .DoSetCellValue 1, 8, 8.98
- .DoSetCellValue 2, 8, -2.07
- .DoSetCellValue 3, 8, 757300
- .DoSetCellValue 4, 8, 9.11
- .DoSetCellValue 5, 8, 154400
- For i = 1 To 6
- .DoSetSortCol i, True
- Next
- .RowSelectedMode = True
- .SideLabelVisible = False
- .PageLabelVisible = False
- .DoShowCurrentCell False, True
- .MultiSelectedMode = False
- .GridReadOnly = True
- .CurrentTopLabelHint = False
- End With
- End Sub
- Private Sub subUserFunc()
- With frmCell.DemoCell
- Dim parmType(4) As Integer
- Dim parmDefault(4) As Integer
- For i = 0 To UBound(parmType) - 1
- parmType(i) = i
- Next
- For i = 0 To UBound(parmDefault) - 1
- parmDefault(i) = 1
- Next
- parmDefault(0) = 0
- .DoAddUserFunctionEx "", "MyFunction1", 0, 4, parmType(0), parmDefault(0), "
- .DoSetFormula 1, 0, "EXP(1)"
- Dim Myfun As String
- Myfun = "MyFunction1(24, " & Chr(34) & "abc" & Chr(34) & ",, A1:B3)"
- .DoSetFormula 2, 0, Myfun
- .PageLabelVisible = False
- End With
- End Sub
- Private Sub subViutual()
- With frmCell.DemoCell
- .DoSetEqualRowHeight True
- .Rows = 16384
- .Cols = 256
- .GridReadOnly = True
- .SideLabelWidth = 100
- .EnablePopMenu = False
- .PageLabelVisible = False
- .DoSetCanDragDrop False
- End With
- End Sub
- Private Sub subChart()
- With frmCell.DemoCell
- .DoSetCellString 0, 0, "interest rate"
- .DoSetCellString 1, 0, "three month"
- .DoSetCellString 2, 0, "half year"
- .DoSetCellString 3, 0, "one year"
- .DoSetCellString 4, 0, "two year"
- .DoSetCellString 5, 0, "three year"
- .DoSetCellString 6, 0, "five year"
- .DoSetCellString 0, 1, "month interest rate"
- .DoSetCellValue 1, 1, 2.4
- .DoSetCellValue 2, 1, 3.45
- .DoSetCellValue 3, 1, 4.725
- .DoSetCellValue 4, 1, 4.95
- .DoSetCellValue 5, 1, 5.175
- .DoSetCellValue 6, 1, 5.55
- .DoSetCellString 0, 2, "year interest rate"
- .DoSetCellValue 1, 2, 2.88
- .DoSetCellValue 2, 2, 4.14
- .DoSetCellValue 3, 2, 5.67
- .DoSetCellValue 4, 2, 5.94
- .DoSetCellValue 5, 2, 6.21
- .DoSetCellValue 6, 2, 6.66
- .DoJoinCells 1, 4, 5, 8
- .DoSetRefChart 1, 4, 0, 0, 6, 2
- .DoJoinCells 1, 10, 5, 14
- .DoSetChart 1, 10, 5, 5
- .DoSetChartStringData 1, 10, 0, 0, "Area"
- .DoSetChartStringData 1, 10, 1, 0, "Washington"
- .DoSetChartStringData 1, 10, 2, 0, "New York"
- .DoSetChartStringData 1, 10, 3, 0, "Florida"
- .DoSetChartStringData 1, 10, 4, 0, "Colorado"
- .DoSetChartStringData 1, 10, 0, 1, "first quarter"
- .DoSetChartStringData 1, 10, 0, 2, "second quarter"
- .DoSetChartStringData 1, 10, 0, 3, "third quarter"
- .DoSetChartStringData 1, 10, 0, 4, "fourth quarter"
- .DoSetChartValueData 1, 10, 1, 1, 29876
- .DoSetChartValueData 1, 10, 1, 2, 34123
- .DoSetChartValueData 1, 10, 1, 3, 42221
- .DoSetChartValueData 1, 10, 1, 4, 52123
- .DoSetChartValueData 1, 10, 2, 1, 32365
- .DoSetChartValueData 1, 10, 2, 2, 35432
- .DoSetChartValueData 1, 10, 2, 3, 30283
- .DoSetChartValueData 1, 10, 2, 4, 45322
- .DoSetChartValueData 1, 10, 3, 1, 32007
- .DoSetChartValueData 1, 10, 3, 2, 23481
- .DoSetChartValueData 1, 10, 3, 3, 40624
- .DoSetChartValueData 1, 10, 3, 4, 34528
- .DoSetChartValueData 1, 10, 4, 1, 31232
- .DoSetChartValueData 1, 10, 4, 2, 30345
- .DoSetChartValueData 1, 10, 4, 3, 27943
- .DoSetChartValueData 1, 10, 4, 4, 32109
- .DoSetChartGeneralData 1, 10, 1, False, "sale", "figure2", "thousand dollar"
- .DoRefreshChart 1, 10
- End With
- End Sub
- Private Sub subFormula()
- With frmCell.DemoCell
- .DoSetCellString 0, 1, "January"
- .DoSetCellString 1, 1, "February"
- .DoSetCellString 2, 1, "March"
- .DoSetCellString 3, 1, "first quarter"
- .DoSetCellString 4, 1, "this year"
- .DoSetCellValue 0, 2, 567.5
- .DoSetCellValue 1, 2, 679.3
- .DoSetCellValue 2, 2, 368.3
- .DoSetFormula 3, 2, "a3+b3+c3"
- .DoSetFormula 4, 2, "d3*4"
- .PageLabelVisible = False
- End With
- End Sub
- Private Sub subInput()
- With frmCell.DemoCell
- .DoSetCellString 0, 1, "Upper case in B2"
- .DoSetCellInputControlCase 1, 1, 1
- .DoSetCellString 0, 3, "Date format in B4"
- .DoSetCellInputControlMask 1, 3, "99-99-9999"
- .DoSetCellString 0, 5, "Value range(50.0 -- 80.0) B6"
- .DoSetCellInputOnlyValue 1, 5, True, 80#, True, 50#
- .DoSetCellString 0, 7, "Input not allowed in B8"
- .DoSetColWidth 0, 300
- .DoSetColWidth 1, 160
- .PageLabelVisible = False
- End With
- End Sub
- Private Sub subCopy()
- frmCell.DemoCell.EnablePopMenu = True
- frmCell.DemoCell.GridReadOnly = False
- frmCell.DemoCell.MultiSelectedMode = True
- End Sub
- Private Sub subCellType()
- With frmCell.DemoCell
- .DoSetCellString 0, 1, "Button"
- .DoSetCellString 0, 3, "Check box"
- .DoSetCellString 0, 5, "Radio button"
- .DoSetCellString 0, 7, "Drop list"
- .DoSetCellString 0, 9, "Spin"
- .DoSetCellString 0, 11, "Step Spin"
- .DoSetCellString 0, 14, "Drop window"
- .DoSetButtonCell 2, 1, "press me", "You pressed the button!"
- .DoSetCheckboxCell 2, 3, "check box"
- .DoSetRadioCell 2, 5, "up" & vbCrLf & "down"
- .DoSetDroplistCell 2, 7, "by bus" & vbCrLf & "by plane" & vbCrLf & "by train", 0, 1
- .DoSetTextSpinCell 2, 9, "up" & vbCrLf & "down" & vbCrLf & "medium"
- .DoSetValueSpinCell 2, 11, 0, 100, 10
- .DoSetDropGridCell 2, 14, 0, 0, 5, 5, 0, 0, 0, 0, 0
- .DoSetDroplistCell 3, 7, "by bus" & vbCrLf & "by plane" & vbCrLf & "by train", 1, 1
- .DoSetDroplistCell 4, 7, "by bus" & vbCrLf & "by plane" & vbCrLf & "by train", 0, 0
- .DoSetCellString 4, 7, "Input here!"
- .DoSetCellString 3, 7, "come here!"
- .DoSetCellValue 2, 11, 0
- .DoSetRowHeight 5, 150
- .PageLabelVisible = False
- .DoJoinCells 3, 0, 5, 6
- If Right(App.Path, 1) = "\" Then
- tmp = App.Path + "garbo.jpg"
- Else
- tmp = App.Path + "\garbo.jpg"
- End If
- .DoSetCellPicture 3, 0, tmp, 1
- End With
- End Sub
- Private Sub subCellStyle()
- With frmCell.DemoCell
- .DoSetCellString 0, 0, "Align left"
- .DoSetCellAlignment 0, 0, 1
- .DoSetCellString 0, 1, "Align right"
- .DoSetCellAlignment 0, 1, 2
- .DoSetCellString 0, 2, "Align medium"
- .DoSetCellAlignment 0, 2, 4
- .DoSetCellString 0, 3, "Align top"
- .DoSetCellAlignment 0, 3, 8
- .DoSetCellString 0, 4, "Align bottom"
- .DoSetCellAlignment 0, 4, 16
- .DoSetCellString 0, 5, "Align v_medium"
- .DoSetCellAlignment 0, 5, 32
- .DoSetCellString 1, 0, "Word break"
- .DoSetCellTextStyle 1, 0, 1
- For i = 0 To 6
- .DoSetRowHeight i, 50
- Next
- For i = 1 To 5
- For j = 3 To 6
- .DoSetCell3DState i, j, 1
- .DoSetCellString 1, 3, "This Style is suitable for form head"
- Next
- Next
- For i = 1 To 5
- For j = 8 To 12
- .DoSetCell3DState i, j, 2
- Next
- Next
- .PageLabelVisible = False
- End With
- End Sub
- Private Sub LoadCell()
- With frmCell.DemoCell
- .RowSelectedMode = False
- .EnablePopMenu = False
- .DoSetDefaultColWidth 100
- .DoSetDefaultRowHeight 20
- End With
- End Sub
- Private Sub subDrag()
- With frmCell.DemoCell
- .MultiSelectedMode = True
- .PageLabelVisible = False
- .GridReadOnly = False
- End With
- End Sub
- Private Sub Form_Load()
- frmMain.WindowState = 2
- End Sub
- Private Sub mnuExit_Click()
- End Sub
- Private Sub mnuFeatures_Click(Index As Integer)
- On Error Resume Next
- iSelection = Index
- LoadCell
- frmCell.Caption = "Cell Demo " & mnuFeatures(Index).Caption
- frmCell.picPicture(Index - 1).ZOrder
- Select Case Index
- Case 4
- subCellStyle
- Case 5
- subCellType
- Case 6
- subInput
- Case 7
- subFormula
- Case 8
- subChart
- Case 9
- subViutual
- Case 10
- subUserFunc
- Case 11
- subCopy
- Case 12
- subDrag
- Case 13
- subSort
- Case 14
- subPrint
- Case 15
- subPages
- Case 16
- subDropWindow
- End Select
- frmCell.Show vbModal
- End Sub
- Private Sub mnuHelpAbout_Click()
- MsgBox "Cell VB Demo" & vbCrLf & vbCrLf & "Author
- Jack Yin" & vbCrLf & " jackyyin@nease.net", vbInformation
- End Sub
-